<html>
<head><meta charset="utf-8"><title>static rlib construction/relocations issue · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/static.20rlib.20construction.2Frelocations.20issue.html">static rlib construction/relocations issue</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="207808450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/static%20rlib%20construction/relocations%20issue/near/207808450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua M. Clulow <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/static.20rlib.20construction.2Frelocations.20issue.html#207808450">(Aug 24 2020 at 05:22)</a>:</h4>
<p>Hi.  I'm seeing an issue with the Rust toolchain build on an illumos system.  The rough gist is: the LLVM archives (*.a) seem to get build correctly (with -fPIC) such that they will work in the subsequent librustc_llvm shared library.  But, whatever process it is that takes those *.a and turns them into an *.rlib seems to alter the program text in a way that is confusing our linker.  The resultant binary seems to have some R_X86_64_PC32 relocations left in what need to be read-only text sections.</p>
<p>Is there some information on how "rustc-link-lib=static=..." works, with particular respect to transformation of the input objects, somewhere?  Or should I just read through the compiler source some more?</p>
<p>Thanks!</p>



<a name="207809217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/static%20rlib%20construction/relocations%20issue/near/207809217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/static.20rlib.20construction.2Frelocations.20issue.html#207809217">(Aug 24 2020 at 05:43)</a>:</h4>
<p>When staticlibs are included in an rlib it just copies the object files. It doesn't change them.</p>



<a name="207813380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/static%20rlib%20construction/relocations%20issue/near/207813380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua M. Clulow <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/static.20rlib.20construction.2Frelocations.20issue.html#207813380">(Aug 24 2020 at 07:17)</a>:</h4>
<p>Interesting.  I'll keep digging then.  Thanks.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>